<?php

namespace Common\Model;
use Think\Model;
 
Class MallGoodsModel extends Model
{
    protected $_auto = array(
        array('created_at', NOW_TIME, self::MODEL_INSERT),
        array('updated_at', NOW_TIME, self::MODEL_BOTH),
        array('content', 'getContent', self::MODEL_BOTH, 'callback'),
        array('recommend', 'intval', self::MODEL_BOTH, 'function'),
    );  
    
    
    public function getContent()
    {
        return json_encode(I('content'));
    }


    public function _after_find(&$result,$options)
    {
        $result['content'] = !empty($result['content']) ? json_decode($result['content'], true) : [];
    }



}